<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"
	content="width=device-width,initial-scale=1,user-scalable=0">
<title>用户列表</title>
<link href="//cdn.bootcss.com/weui/0.4.0/style/weui.min.css"
	rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/register.css" />
<link href="css/jquery-weui.css" rel="stylesheet">
<script src="http://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery-weui.js"></script>
<script type="text/javascript" src="js/laytpl.js"></script>
<script type="text/javascript">
	$.getJSON("user/userlist?format=json&limit=3&offset=0",function(data){
		console.log(data.rows);
		var tpl=document.getElementById('tpl').innerHTML;
		laytpl(tpl).render(data.rows, function(render){
		    document.getElementById('view').innerHTML = render;
		});
	});
</script>
</head>
<body ontouchstart>

	<div class="container">
		<div id="view"></div>
		<script id="tpl" type="text/html">
		{{# for(var i=0;i<d.length;i++){ }}
			<div class="weui_panel weui_panel_access">
			<div class="weui_panel_hd">这是用户名:{{d[i].name}}</div>
			<div class="weui_panel_bd">
				<a class="weui_media_box weui_media_appmsg"
					href="javascript:void(0);">
					<div class="weui_media_hd">
						<img alt=""
							src=""
							class="weui_media_appmsg_thumb">
					</div>
					<div class="weui_media_bd">
						<h4 class="weui_media_title">{{d[i].name}}</h4>
						<p class="weui_media_desc">{{d[i].deliveryaddress}}</p>
					</div>
				</a>
			</div>
			<a href="javascript:void(0);" class="weui_panel_ft">查看详情</a>
		</div>
		{{# } }}
	   </script>
</body>
</html>